package Others.DesignPattern.StrategyPattern.Original.SimpleFactory;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RebateCollectMoney extends CollectMoney {

    //消费达到多少
    private double moneyCondition;
    //返利多少
    private double moneyReturn;

    @Override
    public double collectMoney(double money) {
        if (money >= moneyCondition)
            return money - moneyReturn;
        return money;
    }
}
